# Maintainer: Hoang Nguyen <folliekazetani@protonmail.com>
pkgname=tanka
pkgver=0.26.0
pkgrel=2
pkgdesc="Flexible, reusable and concise configuration for Kubernetes"
url="https://tanka.dev"
# blocked by kubectl (kubernetes)
arch="all !armhf !riscv64"
license="Apache-2.0"
depends="kubectl"
makedepends="go"
source="$pkgname-$pkgver.tar.gz::https://github.com/grafana/tanka/archive/refs/tags/v$pkgver.tar.gz"

export CGO_ENABLED=0
export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	go build -v \
		-ldflags "-X github.com/grafana/tanka/pkg/tanka.CurrentVersion=v$pkgver" \
		./cmd/tk
}

check() {
	# /pkg/helm test requires helm.
	# Tests timeout with helm installed.
	# shellcheck disable=2046
	go test $(go list ./... | grep -v /pkg/helm)
}

package() {
	install -Dm755 tk -t "$pkgdir"/usr/bin/
}

sha512sums="
1f8a59b75f73c5b743674f9cff646f6f2401c800b75cb5aa5af31cd7d0df807d08eee47d4e5aa96c6889737a655a1abd8e959b7285bce1637e9258fa2c763384  tanka-0.26.0.tar.gz
"
